package com.yy.extend_.exercise;

/**
 * chapter08  com.yy.extend_.exercise
 * 2023-04-05 17:58
 *
 * @author yy yuyue
 * description : 不可描述
 * @date 2023/4/5 17:58
 */
public class ExtendsExercise02 {
    public static void main(String[] args) {
        C c = new C();

    }
}
class A{//A类
    public A(){
        System.out.println("我是A类");
    }

}
class B extends A{ //B类继承A类      //main方法中:  C c = new C();  输出什么内容
    public B(){
        System.out.println("我是B类的无参构造器");
    }
    public B(String name){
        System.out.println(name + "我是B类的有参构造器");
    }

}
class C extends B{    //C类 继承B类
    public C() {

        this("hello");
        System.out.println("我是C类的无参构造器");
    }
        public C(String name){
            super("hahah");
            System.out.println("我是C类的有参构造器");
        }


}
